package day05.HomeWork;

import java.util.Arrays;
import java.util.Random;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/5 17:57
 */
public class homeWork {
    public static void main(String[] args) {
        int[]aa={1,2,3,4};
//        System.out.println(aa[2]);
//        System.out.println(aa[0]);
//        for (int i=0;i<aa.length;i++){
//            System.out.print(aa[i]);
//        }
//        System.out.println();
//        int[] bb= Arrays.copyOf(aa,5);
//        for (int i=0;i<bb.length;i++){
//            System.out.println(bb[i]);
//        }



//        int max=aa[0];
//        for (int i=0;i<aa.length;i++){
//            if (max<aa[i]){
//                max=aa[i];
//            }
//        }
//        System.out.println("最大值"+max);


//        say();
//        say("liming");
//        say("lihau",20);
//        sum("lihua",40);
        generateArry(5,10);
    }
    public static void say(){
        int aa=100;
        System.out.println(aa);
    }

    public static void say(String name){
        int aa=1000;
        System.out.println(name+aa);
    }
    public static void say(String name,int max){
        System.out.println(name+max);
    }
    public static void sum(String name,int max){
        if (max>60){
            System.out.println(name+"我是天下第二");
            return;
        }
        System.out.println(name+"我是天下第一");
    }


    public static int []generateArry(int length,int max){
        Random ran=new Random();
        int[] arr=new int[length];
        for (int i=0;i<length;i++){
            arr[i] = ran.nextInt(max);
            System.out.print(arr[i]+" ");

        }
        return arr;
    }
}
